<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="js/vue.js"></script>
  <style>
    img{ width:250px; } 
  </style>
</head>
<body>
  <!--点哪个部位，就喊哪个部位疼！-->
  <div id="app">
    <img src="img/liang.jpg" @click="say">
    <img src="img/tao.jpg" @click="say">
  </div>
  <script>
    new Vue({
      el:"#app",
      methods:{
        say(e){
          if(e.offsetY<110){
            console.log(`头疼!`)
          }else if(e.offsetY<220){
            console.log(`胸疼!`)
          }else{
            console.log(`肚子疼`)
          }
        }
      }
    })
  </script>
</body>
</html>
